<!--行业新闻-->
<style lang="less">
  .h54{
    height:54px;
  }
</style>
<template>
  <div class="contain">
    <div :class="{h54:showstate}">
      <div class="listhead-fix">
        <index-tab :status='1'></index-tab>
      </div>
    </div>
    <div class="news-list">
    <template v-for="item in todolist">
      <router-link :to="{path:'/newsDetail',query:{id:item.guid}}" class="news-list-row displayflex">
        <dl class="news-brief flex1">
          <dt>{{item.title}}</dt>
          <dd>{{item.pubpersonname}}
            <em class="time">{{item.pubdate | jsDateDiff}}</em>
          </dd>
        </dl>
        <div class="pic"><img src="~images/default/none.jpg"></div>
      </router-link>
    </template>
    </div>
    <!-- <div @click="selectImgFromCamera">从相册中选择图片</div> -->
    <manage-footer :status='1'></manage-footer>
  </div>
</template>

<script>
import manageFooter from "@/components/core/footer/manage.footer.vue";
import indexTab from "@/components/core/header/index_tab.vue";

export default {
  components: {
    manageFooter,
    indexTab
  },
  data() {
    return {
      todolist: [],
      showstate:false,
    };
  },
  created() {
    document.title = "行业新闻";
    if(localStorage.userinfo && (JSON.parse(localStorage.userinfo)).UserBizType == "Salesman"){
      this.showstate = true;
    };
    // this.getdata();
  },
  mounted() {
    this.$nextTick(function() {});
  },
  methods: {
    /**
     * 从相册中选择图片
     * @Author   yuyu
     * @DateTime 2017-09-22
     * @return   {[type]}                 [description]
     */
    selectImgFromCamera() {
      // 扩展API加载完毕后调用onPlusReady回调函数
      document.addEventListener("plusready", onPlusReady, false);
      // 扩展API加载完毕，现在可以正常调用扩展API
      function onPlusReady() {}

      plus.gallery.pick(function(e) {
        // 从相册中选择图片
        console.log("从相册中选择多张图片:");
        plus.gallery.pick(
          function(e) {
            for (var i in e.files) {
              console.log(e.files[i]);
            }
          },
          function(e) {
            console.log("取消选择图片");
          },
          { filter: "image", multiple: true }
        );
      });
    },
    getdata() {
      var self = this;
      var query = {
        searchWord: "",
        typecode: "",
        days: "",
        page: 1,
        size: 6
      };
      this.Ajax.post("getNewslist", query).then(function(resp) {
        self.todolist = resp.data.list;
      });
    }
  }
 
};
</script>